import { pageType } from '@/types'
import request from '@/utils/request'

// 获取用户地址详细
export function getUserAddressDetail(data:{id:number | string}) {
    return request({
        url: 'user.userAddress/detail',
        method: 'GET',
        data
    })
}

// 获取用户地址列表
export function getUserAddressList(data:pageType) {
    return request({
        url: 'user.userAddress/list',
        method: 'GET',
        data
    })
}
// 添加地址
export function createUserAddress(data:any) {
    return request({
        url: 'user.userAddress/create',
        method: 'POST',
        data
    })
}
// 修改地址
export function updateUserAddress(data:any) {
    return request({
        url: 'user.userAddress/update',
        method: 'PUT',
        data
    })
}

export function deletedUserAddress(data:{id:number|string}) {
    return request({
        url: 'user.userAddress/delete',
        method: 'DELETE',
        data
    })
}
